package br.ubigroup.jena;


import java.io.Serializable;
//import java.lang.reflect.ParameterizedType;
//import java.util.List;

import br.ubigroup.jena.Dao;

public abstract class DaoImpl<T, ID extends Serializable> implements Dao<T, ID> {
  
	private Class<T> persistentClass;
  
  //@PersistenceContext(name = "darkconnection")
	//protected EntityManager entityManager;
	//Root<T> root;
  
  //@SuppressWarnings("rawtypes")
	//TypedQuery q;

	//@SuppressWarnings("unchecked")
  public DaoImpl() {
	  //this.persistentClass = (Class<T>) ((ParameterizedType) getClass()
	  //.getGenericSuperclass()).getActualTypeArguments()[0];
	  //;
  }

  public Class<T> getPersistentClass() {
	  return persistentClass;
  }

  //@Transactional(readOnly = true)
  /*public T getById(ID id) {
	  //return entityManager.find(persistentClass, id);
	T t;
    return t;    
  }*/

  //@Transactional
  public void persist(T entity) {
    //entityManager.persist(entity);
  }

  //@Transactional
  public void update(T entity) {
	  //entityManager.merge(entity);
  }

  //@Transactional
  public void delete(T entity) {
	  //Object o = entityManager.merge(entity);
	  //entityManager.remove(o);
  }

  //@Transactional
  public void refresh(T entity) {
	  //entityManager.refresh(entity);
  }

  //@Transactional(readOnly = true)
  //@SuppressWarnings("unchecked")
 /* public List<T> getList() {
	  //return entityManager.createQuery(
	  //"Select t from " + persistentClass.getSimpleName() + " t")
	  //.getResultList();
  }*/
  
}